I have a requirement in which I am maintaining a value "Deleted" in a column like "Marked". I want a DXL script which will go through the column "Marked" and delete all the requirements which have "Deleted" keyword in that column. |
Re: DXL script to delete requirements in DOORS based on a attribute value Find the script in the attachment. Open the module in exclusive edit and run this script. Remember this is a hard delete, you cannot undelete the objects again. Regards, Naveen Attachments attachment_14622425_delete_Objects_based_on_attribute_value.dxl |
Re: DXL script to delete requirements in DOORS based on a attribute value SystemAdmin - Mon May 30 07:52:23 EDT 2011 Reasons not to use the script: It does warn about what it is going to do. It is a bad idea to delete objects in the middle of a for object in loop. You should place the objects in a skip list first, then loop through the skip list. Use of the delete() function is no longer recommended. Use softDelete(). Never purge (hard delete) objects just like that. Soft-delete, baseline, then purge if you are sure. Tony Goodman www.smartdxl.com |
Re: DXL script to delete requirements in DOORS based on a attribute value Tony_Goodman - Tue May 31 08:51:10 EDT 2011 use "hardDelete" instead of "delete", easier to understand. In fact, I'd be tempted two write a quick "purge(obj)" function that simply calls hardDelete, just to make it crystal clear. don't forget to "flushDeletions". don't forget you cannot "hardDelete" an already "softDeleted" object: .. if (isDeleted(obj)) undelete(obj) .. hardDelete(obj) don't forget to trap errors: .. noError() .. hardDelete(obj) .. ErrMess = lastError() .. if (!null ErrMess) then report the error don't forget to save the module ... I suppose
|
Re: DXL script to delete requirements in DOORS based on a attribute value llandale - Tue May 31 14:45:09 EDT 2011
|